* src/editfns.c (Fget_pos_property): Fix thinko (bug#69358)
authorStefan Monnier <monnier@iro.umontreal.ca>
Sat, 24 Feb 2024 17:23:41 +0000 (12:23 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sat, 24 Feb 2024 17:23:41 +0000 (12:23 -0500)
src/editfns.c

index cce52cddbf873a36d464302288b3833c928a7200..4ccf765bd4bc29d1c9a4543bf5ef21506caff629 100644 (file)
@@ -301,8 +301,8 @@ at POSITION.  */)
       struct buffer *obuf = current_buffer;
       struct itree_node *node;
       struct sortvec items[2];
-      struct sortvec *result = NULL;
       struct buffer *b = XBUFFER (object);
+      struct sortvec *result = NULL;
       Lisp_Object res = Qnil;
 
       set_buffer_temp (b);
@@ -326,7 +326,10 @@ at POSITION.  */)
           if (NILP (res)
               || (make_sortvec_item (this, node->data),
                   compare_overlays (result, this) < 0))
-            res = tem;
+            {
+              result = this;
+              res = tem;
+            }
        }
       set_buffer_temp (obuf);